package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.Leixing;
import com.ysd.entity.Redian;
import com.ysd.util.DBManager;

public class RedianDaoImpl {
	public List<Redian> getRedian() {
		List<Redian> list = new ArrayList<Redian>();
		Connection rd = DBManager.getConnection();
		Statement st = null;
		ResultSet rs = null;
		
		try {
			st = rd.createStatement();
			rs = st.executeQuery("select * from redian");
			while (rs.next()) {
				String biaoTi = rs.getString("biaoTi");
				String jianJie = rs.getString("jianJie");
				String neiRong = rs.getString("neiRong");
				Redian redian = new Redian(biaoTi, jianJie, neiRong);
				list.add(redian);
			}
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		} finally {
			DBManager.closeAll(rd, st, rs);
		}
	}
}
